home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / src / swtools / mipsABI / examples / sup / PORT / step06 / supcmain.c.diff < prev    next >
Encoding:
Text File  |  1994-08-02  |  1000 b   |  43 lines

  1. *** ../step03/supcmain.c    Thu Dec 16 14:59:50 1993
  2. --- supcmain.c    Fri Dec 17 12:49:40 1993
  3. ***************
  4. *** 325,330 ****
  5. --- 325,334 ----
  6.   #define SYS_rpause    (-5)
  7.   #endif
  8.   #endif
  9. + #ifdef _ABI_SOURCE
  10. + /*XXX #include <sys/time.h> */
  11. + #include <sys/resource.h>
  12. + #endif
  13.   
  14.   /*********************************************
  15.    ***    G L O B A L   V A R I A B L E S    ***
  16. ***************
  17. *** 360,365 ****
  18. --- 364,370 ----
  19.       struct stat sbuf;
  20.   #ifdef _ABI_SOURCE
  21.       struct sigaction ignvec,oldvec;
  22. +     struct rlimit rl;
  23.   #else
  24.       struct sigvec ignvec,oldvec;
  25.   #endif
  26. ***************
  27. *** 420,427 ****
  28. --- 425,438 ----
  29.               int fd;
  30.               loginfo ("SUP Restarting %s with new supfile %s",
  31.                   progname,supfname);
  32. + #ifdef _ABI_SOURCE
  33. +             getrlimit (RLIMIT_NOFILE, &rl);
  34. +             for (fd = rl.rlim_max; fd > 3; fd--)
  35. +                 (void) close (fd);
  36. + #else
  37.               for (fd = getdtablesize (); fd > 3; fd--)
  38.                   (void) close (fd);
  39. + #endif
  40.               execv (progname,argv);
  41.               logquit (1,"Restart failed");
  42.           }
  43.